package com.qf.common.core.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @author zdl
 * @date 2025/3/28
 */
@Data
@TableName("grass_comment")
public class GrassComment {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer grassId;
    private Integer uid;
    private String content;
    private Integer parentId;  // 父评论ID
    private Integer rootId;    // 根评论ID
    private Date createTime;
    private Date updateTime;

    // 非数据库字段 - 用于存储该评论下的回复列表
    @TableField(exist = false)  // 表示不是数据库字段
    private List<GrassComment> replies;
}
